package com.cdl.utils.bean;

import java.util.Properties;

import com.cdl.utils.PropertyUtil;

public class PropertyInfo {
	
	private static Properties properties = PropertyUtil.InitProp();
	
	private String 	javaRootPath	;   
	private String 	entityPath		; //Entity所在包名
	private String 	controllerPath	; //Controller所在包名
	private String 	servicePath		; //Service所在包名
	private String 	serviceImplPath	; //ServiceImpl所在包名
	private String 	daoPath		    ; //Mapper所在包名
	private String 	jspRootPath		; //jspRoot所在包名
	private String 	queryJspPath	; //queryJsp所在文件夹
	private String 	mainJspPath		; //mainJsp所在文件夹
	private String 	listJspPath		; //listJsp所在文件夹
	private String 	formJspPath		; //formJsp所在文件夹
	private String 	detailJspPath	; //detailJsp所在文件夹
	private String 	sqlMapRoot		; //
	private String 	sqlMapPath		; //sqlMap所在文件夹
	
	private String  entityPackage   ;  //Entity包名
	private String  controllerPackage   ;  //Entity包名
	private String  servicePackage   ;  //Entity包名
	private String  serviceImplPackage   ;  //Entity包名
	private String  daoPackage   ;  //Entity包名
	
	public PropertyInfo(){
		
		this.javaRootPath = properties.getProperty("javaRootPath");
		this.entityPath = properties.getProperty("entityPath");
		this.controllerPath = properties.getProperty("controllerPath");
		this.servicePath = properties.getProperty("servicePath");
		this.serviceImplPath = properties.getProperty("serviceImplPath");
		this.daoPath = properties.getProperty("daoPath");
		this.jspRootPath = properties.getProperty("jspRootPath");
		this.queryJspPath = properties.getProperty("queryJspPath");
		this.mainJspPath = properties.getProperty("mainJspPath");
		this.listJspPath = properties.getProperty("listJspPath");
		this.formJspPath = properties.getProperty("formJspPath");
		this.detailJspPath = properties.getProperty("detailJspPath");
		this.sqlMapRoot = properties.getProperty("sqlMapRoot");
		this.sqlMapPath = properties.getProperty("sqlMapPath");

		if(this.entityPath!=null){
			this.entityPackage = this.entityPath.replace("\\", ".").substring(1);
		}
		if(this.controllerPath!=null){
			this.controllerPackage = this.controllerPath.replace("\\", ".").substring(1);
		}
		if(this.servicePath!=null){
			this.servicePackage = this.servicePath.replace("\\", ".").substring(1);
		}		
		if(this.serviceImplPath!=null){
			this.serviceImplPackage = this.serviceImplPath.replace("\\", ".").substring(1);
		}		
		if(this.daoPath!=null){
			this.daoPackage = this.daoPath.replace("\\", ".").substring(1);
		}
		
		
	}
	
	

    
	public String getJavaRootPath() {
		return javaRootPath;
	}




	public String getEntityPath() {
		return entityPath;
	}




	public String getControllerPath() {
		return controllerPath;
	}




	public String getServicePath() {
		return servicePath;
	}




	public String getServiceImplPath() {
		return serviceImplPath;
	}

	public String getDaoPath() {
		return daoPath;
	}


	public String getJspRootPath() {
		return jspRootPath;
	}




	public String getQueryJspPath() {
		return queryJspPath;
	}




	public String getMainJspPath() {
		return mainJspPath;
	}




	public String getListJspPath() {
		return listJspPath;
	}




	public String getFormJspPath() {
		return formJspPath;
	}




	public String getDetailJspPath() {
		return detailJspPath;
	}




	public String getSqlMapRoot() {
		return sqlMapRoot;
	}




	public String getSqlMapPath() {
		return sqlMapPath;
	}




	public String getEntityPackage() {
		return entityPackage;
	}




	public String getControllerPackage() {
		return controllerPackage;
	}




	public String getServicePackage() {
		return servicePackage;
	}




	public String getServiceImplPackage() {
		return serviceImplPackage;
	}




	public String getDaoPackage() {
		return daoPackage;
	}




	@Override
	public String toString() {
		return "PropertyInfo [javaRootPath=" + javaRootPath + ", entityPath="
				+ entityPath + ", controllerPath=" + controllerPath
				+ ", servicePath=" + servicePath + ", serviceImplPath="
				+ serviceImplPath + ", daoPath=" + daoPath + ", jspRootPath="
				+ jspRootPath + ", queryJspPath=" + queryJspPath
				+ ", mainJspPath=" + mainJspPath + ", listJspPath="
				+ listJspPath + ", formJspPath=" + formJspPath
				+ ", detailJspPath=" + detailJspPath + ", sqlMapRoot="
				+ sqlMapRoot + ", sqlMapPath=" + sqlMapPath
				+ ", entityPackage=" + entityPackage + ", controllerPackage="
				+ controllerPackage + ", servicePackage=" + servicePackage
				+ ", serviceImplPackage=" + serviceImplPackage
				+ ", daoPackage=" + daoPackage + "]";
	}




	public static void main(String[] args) {
		
		
		PropertyInfo p = new PropertyInfo();
		System.out.println(p.toString());
		
	}
	
	
}
